package cn.wokoba.dao.dao;

import cn.wokoba.dao.dao.po.NotifyTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface INotifyTaskDao extends BaseMapper<NotifyTask> {

    @Update("""
               update notify_task
                    set notify_count = notify_count + 1, notify_status = 1, update_time = now()
                    where team_id = #{teamId}\
            """)
    int updateNotifyTaskStatusSuccess(String teamId);

    @Update("""
                  update notify_task
                    set notify_count = notify_count + 1, notify_status = 3, update_time = now()
                    where team_id = #{teamId}\
            """)
    int updateNotifyTaskStatusError(String teamId);

    @Update("""
                  update notify_task
                    set notify_count = notify_count + 1, notify_status = 2, update_time = now()
                    where team_id = #{teamId}\
            """)
    int updateNotifyTaskStatusRetry(String teamId);

}
